<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
	<style type="text/css">
		.father{
			width: 300px;
			height: 300px;
			background: skyblue;
		}
		.son{
			width: 100px;
			height: 100px;
			background: pink;
		}
	</style>
</head>
<body>
	<div class="father">
		<div class="son"></div>
	</div>
	<script type="text/javascript">
		// 1.事件存在三个阶段：事件捕获阶段，目标阶段，冒泡阶段
		// 冒泡阶段：事件到达目标后，不会结束，而是回逐层向上传递，直到document
		let father = document.querySelector(".father")
		let son = document.querySelector(".son")

		son.onclick = function(){
			console.log('我是儿子')
		}
		father.onclick = function(){
			console.log('我是爸爸')
		}
		document.querySelector('body').onclick=function(){
			console.log('body')
		}
	</script>
</body>
</html>